﻿Imports System.Data.SqlClient
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Enterprise
Imports System.Drawing.Font
Imports DMC.Land.User
Imports Microsoft.Reporting.WinForms
Public Class frmSoDiaChinh
    Private strMaHoSoCapGCN As String = ""
    Private conn As New SqlConnection
    Private strMaDVHC As String = ""
    Private strConnection As String = ""
    Private DTChu As New DataTable
    Private DTDat As New DataTable
    Private DTNoiDung As New DataTable
    Public Property DB() As DataTable
        Get
            Return DTChu
        End Get
        Set(ByVal value As DataTable)
            DTChu = value
        End Set
    End Property
    Public Property TB() As DataTable
        Get
            Return DTDat
        End Get
        Set(ByVal value As DataTable)
            DTDat = value
        End Set
    End Property
    Public Property TT() As DataTable
        Get
            Return DTNoiDung
        End Get
        Set(ByVal value As DataTable)
            DTNoiDung = value
        End Set
    End Property

    Public Function fileReport() As String
        Dim ViTri As Short
        Dim path As String
        ViTri = InStr(4, Application.ExecutablePath, "\", CompareMethod.Binary)
        path = Application.ExecutablePath.Substring(0, ViTri) & Application.ProductName
        Dim file As String = ""
        file = Application.StartupPath & "\ReportsBC\SoDiaChinhrpt.rpt"
        Return file
    End Function
    Public Sub LoadReport()

        reportDocument1.FileName = fileReport()
        'KNReports(reportDocument1)
        ' reportDocument1.Subreports("SoMucKeChinh").SetDataSource(DTChinh)
        reportDocument1.Subreports("ThuaDat").SetDataSource(DTDat)
        reportDocument1.Subreports("ThayDoi").SetDataSource(DTNoiDung)
        reportDocument1.SetDataSource(DTChu)

        CrystalReportViewer1.ReportSource = reportDocument1
    End Sub
    

    Private Sub frmSoDiaChinh_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class